package cn.ucai.day01_Object.pa6_review;

public class Test {

	public static void main(String[] args) {
		//引用存放在栈中，对象存放在堆中
		Person p=new Person();
		p.setAge(60);
		p.setName("奥巴马");
		
		Dog dog=new Dog();
		dog.setName("猫咪");
		dog.setAge(2);	
		p.setDog(dog);
		
		Person ch=new Person();
		ch.setName("小奥巴马");
		ch.setAge(8);	
		p.setChild(ch);
		
		System.out.println(p.getName());
		System.out.println(p.getDog().getName());
		System.out.println(p.getChild().getName());

	}

}
